package com.itfreer.data.check;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Index;
import javax.persistence.Table;

import org.springframework.beans.BeanUtils;

import com.itfreer.data.check.entity.CheckConfigEntity;
import com.itfreer.form.api.JdbcBaseEntity;


@Entity(name = "data_check_config")
@Table(indexes = { @Index(name = "check_tacheid", columnList = "s_tacheid"),
		@Index(name = "check_name", columnList = "s_name")})
public class JdbcCheckConfigEntity implements JdbcBaseEntity<CheckConfigEntity>, Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 6871601848498297560L;

	/**
	 * 主键
	 */
	@Id
	@Column(name = "id", nullable = false)
	private String id;
	
	/**
	 * 检查名称
	 */
	@Column(name = "s_name", nullable = false)
	private String name;
	
	/***
	 * 环节id
	 */
	@Column(name = "s_tacheid", nullable = true)
	private String tacheid;
	
	/***
	 * 环节id
	 */
	@Column(name = "s_tachename", nullable = true)
	private String tachename;
	
	/***
	 * 检查事项
	 */
	@Column(name = "s_matter", nullable = true)
	private String matter;
	
	/***
	 * spring注入bean名称
	 */
	@Column(name = "s_beanname", nullable = true)
	private String beanname;
	
	/***
	 * 排序号
	 */
	@Column(name = "i_order", nullable = true)
	private Integer order;
	
	/**
	 * 检查类型（自定义字典项）
	 * 
	 */
	@Column(name = "s_type", nullable = true)
	private String type;
	
	/***
	 * 检查规则
	 */
	@Column(name = "s_rule",length = 2000, nullable = true)
	private String rule;
	
	/***
	 *  检查规则说明
	 */
	@Column(name = "s_ruledesc",length = 2000, nullable = true)
	private String ruledesc;
	
	/***
	 * 检查通过结果
	 */
	@Column(name = "s_passresult",length = 2000, nullable = true)
	private String passresult;
	
	/***
	 * 检查不通过结果
	 */
	@Column(name = "s_unpassresult",length = 2000, nullable = true)
	private String unpassresult;
	
	/***
	 * 通用参数
	 */
	@Column(name = "s_paras",length = 2000 , nullable = true)
	private String paras;
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getTacheid() {
		return tacheid;
	}

	public void setTacheid(String tacheid) {
		this.tacheid = tacheid;
	}

	public String getMatter() {
		return matter;
	}

	public void setMatter(String matter) {
		this.matter = matter;
	}

	public String getBeanname() {
		return beanname;
	}

	public void setBeanname(String beanname) {
		this.beanname = beanname;
	}

	public Integer getOrder() {
		return order;
	}

	public void setOrder(Integer order) {
		this.order = order;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getRule() {
		return rule;
	}

	public void setRule(String rule) {
		this.rule = rule;
	}

	public String getRuledesc() {
		return ruledesc;
	}

	public void setRuledesc(String ruledesc) {
		this.ruledesc = ruledesc;
	}

	public String getPassresult() {
		return passresult;
	}

	public void setPassresult(String passresult) {
		this.passresult = passresult;
	}

	public String getUnpassresult() {
		return unpassresult;
	}

	public void setUnpassresult(String unpassresult) {
		this.unpassresult = unpassresult;
	}
	
	public String getParas() {
		return paras;
	}

	public void setParas(String paras) {
		this.paras = paras;
	}

	public String getTachename() {
		return tachename;
	}

	public void setTachename(String tachename) {
		this.tachename = tachename;
	}

	public void from(CheckConfigEntity t) {
		BeanUtils.copyProperties(t, this);
	}
	
	public CheckConfigEntity toEntity() {
		CheckConfigEntity toEntity = new CheckConfigEntity();
		BeanUtils.copyProperties(this, toEntity);
		return toEntity;
	}	
}
